<?php
$id = empty($_GET['id']) ? 0 : intval($_GET['id']);
if($id > 0){
	$oBrand = new Brand();
	$brand = $oBrand->get_row($id, '*');

	// 关联新闻信息
	if(!empty($brand['related_news'])){
		$ids = explode(',', trim($brand['related_news'], ', '));
		$oNews = new News();
		$brand['related_news_list'] = array();
		foreach($ids as $newsid){
			$brand['related_news_list'][$newsid] = $oNews->get_row($newsid, '`id`,`title`');
		}
		$brand['related_news_json'] = json_encode($brand['related_news_list']);
	}

}else{
	$brand = array('url' => 'http://', 'rank' => 10000);
}
$vars['info'] = $brand;
?>